package models

import (
	"time"
)

type Manager struct {
	ID               int64     `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
	CityID           string    `gorm:"column:city_id;type:varchar(64)" json:"city_id"`
	ProjectID        string    `gorm:"column:project_id;type:varchar(64)" json:"project_id"`
	StaffID          int       `gorm:"column:staff_id;type:int(32);not null" json:"staff_id"`
	StaffName        string    `gorm:"column:staff_name;type:varchar(32);not null" json:"staff_name"`
	StaffChineseName string    `gorm:"column:staff_chinese_name;type:varchar(100);not null" json:"staff_chinese_name"`
	SlockUserID      int       `gorm:"column:slock_user_id;type:int(9);not null" json:"slock_user_id"`
	Status           int       `gorm:"column:status;type:tinyint(4);not null" json:"status"`
	Type             int       `gorm:"column:type;type:tinyint(4);not null" json:"type"`
	CreateTime       time.Time `gorm:"column:create_time;type:datetime;not null" json:"create_time"`
	UpdateTime       time.Time `gorm:"column:update_time;type:datetime;not null" json:"update_time"`
	TelPhone         string    `gorm:"column:tel_phone;type:varchar(32);not null" json:"tel_phone"`
}

// TableName sets the insert table name for this struct type
func (m *Manager) TableName() string {
	return "manager"
}

//// BeforeCreate is a GORM hook that is triggered before a new record is created
//func (m *Manager) BeforeCreate(scope *gorm.Scope) error {
//	scope.SetColumn("CreateTime", time.Now())
//	scope.SetColumn("UpdateTime", time.Now())
//	return nil
//}
//
//// BeforeUpdate is a GORM hook that is triggered before a record is updated
//func (m *Manager) BeforeUpdate(scope *gorm.Scope) error {
//	scope.SetColumn("UpdateTime", time.Now())
//	return nil
//}
